﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>图书管理系统</title>
    <link rel="stylesheet" href="../../static/css/public.css"/>
    <link rel="stylesheet" href="../../static/css/style.css"/>
</head>
<body>
<!--头部-->
    <header class="publicHeader">
        <h1>图书管理系统</h1>
        <div class="publicHeaderR">
            <p><span>下午好！</span><span style="color: #fff21b"> {{ name }}</span>管理员 , 欢迎你！</p>
            <a href="/login?">退出</a>
        </div>
    </header>
<!--时间-->
    <section class="publicTime">
        <span id="time"></span>
        <a href="#">温馨提示：为了能正常浏览，请使用google浏览器！</a>
    </section>
<!--主体内容-->
    <section class="publicMian ">
        <div class="left">
            <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>
            <nav>
                <ul class="list">
                <li ><a href="/manager_information?">个人信息</a></li>
                 <li><a href="/manage_book?">书籍管理</a></li>
                <li><a href="/add_new_book?">采购书籍</a></li>
                <li><a href="/change_manager_password?">密码修改</a></li>
                <li><a href="/manager_login?">退出系统</a></li>
            </ul>
            </nav>
        </div>
        <div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>密码修改页面</span>
            </div>

<script>
    function fun(password) {
        var oldPassword=document.getElementById("oldPassword").value
        var newPassword=document.getElementById("newPassword").value
        var reNewPassword=document.getElementById("reNewPassword").value
        if(newPassword == ''||reNewPassword=='')
            ;
        else
            if (newPassword!=reNewPassword)
                alert('新密码输入不一致！请重新输入')
            else
                if(password == oldPassword)
                    alert('修改成功！')
                else
                    alert('旧密码输入错误！')
    }
</script>
            <div class="providerAdd">
                <form >
                    {% csrf_token %}
                    <div class="">
                        <label for="oldPassword">旧密码：</label>
                        <input type="password" name="oldPassword" id="oldPassword" required/>
                        <span>*请输入原密码</span>
                    </div>
                    <div>
                        <label for="newPassword">新密码：</label>
                        <input type="password" name="newPassword" id="newPassword" required/>
                        <span >*请输入新密码</span>
                    </div>
                    <div>
                        <label for="reNewPassword">确认新密码：</label>
                        <input type="password" name="reNewPassword" id="reNewPassword" required/>
                        <span >*请输入新确认密码，保证和新密码一致</span>
                    </div>
                    <div class="providerAddBtn">
                        <input type="submit" value="保存" onclick="fun('{{ password }}')"formmethod="post"formaction="/change_manager_password/"/>
                    </div>
                </form>
            </div>
        </div>
    </section>
    <footer class="footer">
    </footer>
<script src="../../static/js/time.js"></script>

</body>
</html>